<template>
    <div>
        <v-header></v-header>
        <div class="main">
            <div class="wrapper">
                <v-sidebar :sideNav="sideNav"></v-sidebar>
                <div class="content category2">
                    <transition name="slide-left" mode="out-in"><router-view></router-view></transition>
                </div>
            </div>
        </div>
        <v-footer></v-footer>
    </div>
</template>

<script>
    import vHeader from '../../common/Header.vue';
    import vFooter from '../../common/Footer.vue';
    import vSidebar from '../../common/Sidebar.vue';
    export default {
        data(){
            return{
                // 侧导航栏信息
                sideNav: {
                    column:'Mine',
                    list:[],
                }
            }
        },
        beforeCreate(){   //el和data并未初始化
            // 显示loading
            this.$store.state.isLoading = true;
        },
        mounted(){       // 完成组件挂载
            var self = this;
            // 隐藏loading
            self.$store.state.isLoading = false;
            // main赋值最小高
            $(".main").css({"min-height": $(window).height()-130});
            //获取 localStorage 的存储数据
            let olist = JSON.parse(localStorage.getItem("menuList"));
            for(var i = 0;i <  olist.length;i++){
                if(olist[i].resourceName == '我的'){
                    this.sideNav.list.push(olist[i]);
                }
            }

        },
        components:{
            vHeader,vSidebar,vFooter
        }
    }
</script>
<style>

</style>
